package com.mgetool.ui;


public class XRect {

	private int x;
	private int y;
	private int w;
	private int h;
	
	public XRect() {
		
	}

	public XRect(int x, int y, int width, int height) {
		setPosition(x, y);
		setSize(width, height);
	}

	public void setPosition(int x, int y) {
		this.x = x;
		this.y = y;
	}

	public void setSize(int width, int height) {
		this.w = width;
		this.h = height;
	}

	public boolean isContains(int x, int y){
		return !(x < getX() || x > getRight() || y < getY() || y > getBottom());
	}
	
	public int getRight() {
		return x + w;
	}

	public int getBottom() {
		return y + h;
	}


	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}

	public int getWidth() {
		return w;
	}

	public int getHeight() {
		return h;
	}

}
